package com.songcha.sakura.ui.adapter


import androidx.fragment.app.*
import com.songcha.sakura.mvvm.downloading.DownloadingFragment
import com.songcha.sakura.mvvm.local.video.LocalVideoFragment


/* class HomeCateAdapter(fa:FragmentActivity,val titles:ArrayList<String>) : FragmentStateAdapter(fa) {

    override fun getItemCount(): Int {
       return titles.size
    }

    override fun createFragment(position: Int): Fragment {
        return HomeCateFragment(titles[position])
    }





}*/



 class DownloadingAdapter(fm:FragmentManager, val titles:ArrayList<String>) : FragmentStatePagerAdapter(fm) {
     override fun getCount(): Int {
        return titles.size
     }

     override fun getItem(position: Int): Fragment {
         if(position==1){
             return DownloadingFragment()
         }else{
             return LocalVideoFragment()

         }

     }

     override fun getPageTitle(position: Int): CharSequence? {
         return titles[position]
     }




 }


